package com.chongqing.caller;

import com.alibaba.fastjson.JSONObject;
import com.chongqing.config.Constant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

/**
 * create by yongli on 2021-06-27 14:06
 */
@Service
public class RemoteIamService {

    @Autowired
    private RestTemplate restTemplate;

    public JSONObject postUserPage() {
        String url = Constant.IAM_URL + "/iam/com/iam/user/list-page";
        // postEntity的参数，到底应该填写什么？
        ResponseEntity<JSONObject> ret = restTemplate.postForEntity(url, HttpEntity.EMPTY, JSONObject.class);
        return ret.getBody();
    }


}
